<cfsetting enablecfoutputonly="yes">
<cfinvoke component="cfcs.blog" method="getlatest" returnvariable="qlatest" />
<cfquery name="qsettings" datasource="#request.dsn#">
SELECT * FROM core_settings
</cfquery>
<cfset ndate = #GetHttpTimeString(Now())#>
<cfloop query = "qlatest" startrow="1" endrow="1">
<cfset getlatestdate = CreateDateTime(DatePart("yyyy", b_postedon),DatePart("m", b_postedon),DatePart("d", b_postedon),DatePart("h", b_postedon),DatePart("n", b_postedon),DatePart("s", b_postedon))>
<cfset ldate = #GetHttpTimeString(getlatestdate)#>
</cfloop>
<cfsavecontent variable="blogheaderrss">
<cfset desc = replace(qsettings.meta_description, "'", "&##39;", "ALL")>
<cfoutput>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="#request.homeurl#blog/rss.cfm" rel="self" type="application/rss+xml" />
<title>#xmlFormat(qsettings.meta_title)#</title>
<link>#xmlFormat(request.secureurl)#</link>
<description>#xmlformat(desc)#</description>
<language>#xmlformat('en-us')#</language>
<pubDate>#xmlformat(ndate)#</pubDate>
<lastBuildDate>#xmlformat(ldate)#</lastBuildDate>
<generator>#xmlformat('http://www.cfhowto.com')#</generator>
<docs>#xmlformat('http://blogs.law.harvard.edu/tech/rss')#</docs>
<managingEditor>#xmlFormat('Brian McFadden')#</managingEditor>
<webMaster>#xmlFormat('Jon Wallen')#</webMaster>
</cfoutput>
</cfsavecontent>
<cfsavecontent variable="blogrss">
<cfloop query="qlatest" endrow="15">
<cfset makepostdate = CreateDateTime(DatePart("yyyy", b_postedon),DatePart("m", b_postedon),DatePart("d", b_postedon),DatePart("h", b_postedon),DatePart("n", b_postedon),DatePart("s", b_postedon))>
<cfset pdate = #GetHttpTimeString(makepostdate)#>
<cfif qlatest.currentrow eq 1><cfset grabthisdate = pdate></cfif>
<cfset primecat = listgetat(qlatest.categories, 1)>
<cfquery name="qcat" datasource="#request.dsn#">
SELECT * FROM blog_categories
WHERE id = <cfqueryparam value="#primecat#" cfsqltype="cf_sql_integer">
</cfquery>
<cfset blink = "#request.secureurl#blog/#b_year#/#b_month#/#b_day#/#b_file#?mo=#b_month#&yr=#b_year#">
<cfoutput>			
<cfset the_day = dateformat(b_postedon, "d")>
<cfset the_month = dateformat(b_postedon, "mm")>
<cfset the_year = dateformat(b_postedon, "yyyy")>
<item>
<title>#xmlFormat(b_title)#</title>
<link>#xmlFormat(blink)#</link>
<description>#xmlFormat(REReplace(b_brief,"<[^>]*>","","All"))#</description>
<category>#xmlFormat(qcat.cname)#</category>
<pubDate>#xmlFormat(pdate)#</pubDate>
<guid>#xmlFormat(blink)#</guid>
</item>
</cfoutput>
</cfloop>
</cfsavecontent>
<cfset loadtherss = trim(blogheaderrss & blogrss & "</channel></rss>")>
<cfsetting enablecfoutputonly="no">
<cfoutput><cfcontent type="text/xml"><?xml version="1.0" encoding="ISO-8859-1" ?>#loadtherss#</cfoutput>